home *** CD-ROM | disk | FTP | other *** search
- ************************************************************
- * *
- * CDPD3 Bugfix by P-O Yliniemi *
- * *
- ************************************************************
-
- include "df0:LVOs.i"
-
- move.l _AbsExecBase,a6
- lea.l intuiname(pc),a1
- moveq.l #0,d0
- CallLib OpenLibrary
- move.l d0,intuibase
- beq.s intuierr
-
- move.l d0,a1
- move.l _LVOOpenWindowTagList+2(a1),NoWinTags+6
-
- move.l #FixSize,d0
- move.l #$10001,d1
- CallLib AllocMem
- move.l d0,mem
- beq.s closeintui
-
- move.l d0,a1
- lea.l NewOpenWinTags(pc),a0
- move.l #FixSize,d0
- CallLib CopyMem
-
- CallLib Forbid
- move.l intuibase(pc),a1
- move.l mem,_LVOOpenWindowTagList+2(a1)
- CallLib SumLibrary
- CallLib Permit
-
- closeintui:
- move.l intuibase(pc),a1
- move.l _AbsExecBase,a6
- CallLib CloseLibrary
- intuierr:
- moveq.l #0,d0
- rts
-
- ;---------------------------------------------------------------------
- mem: dc.l 0
- intuibase:
- dc.l 0
- intuiname:
- dc.b "intuition.library",0
-
- ;--------------------------------------------------------------------
- NewOpenWinTags:
- movem.l d2/a2,-(sp)
- cmp.l #0,a0 ; Do we have a NewWindow structure ?
- beq.s .NoNewWin ; Nope! Check for Tags!
- move.l 26(a0),d0 ; Check title string
- beq.s .NoNewWin ; No title
- move.l d0,a2
- cmp.b #"F",(a2)+ ; Check for "F"
- bne.s .NoNewWin
- cmp.b #"F",(a2)+ ; Check for "F"
- bne.s .NoNewWin
-
- move.w #0,0(a0) ; LeftEdge = 0
- move.w #0,2(a0) ; TopEdge = 0
- move.w #640,4(a0) ; Width = 640
- move.w #100,6(a0) ; Height = 100
- .NoNewWin:
- cmp.l #0,a1 ; Do we have any tags ?
- beq.w NoWinTags ; Nope! Use ordinary OpenWindowTagList()
- move.l a1,a2 ; Pointer to tag list
- move.l #$8000006e,d2 ; Tag to search for = WA_Title
- bsr.s FindTag
- tst.l d2
- beq.s NoWinTags ; No title
- move.l d2,a2 ; Address of title to A2
- cmp.b #"F",(a2)+ ; Check for "F"
- bne.s NoWinTags
- cmp.b #"F",(a2)+ ; Check for "F"
- bne.w NoWinTags
-
- move.l a1,a2 ; Pointer to tag list
- move.l #$80000064,d2 ; Search for WA_Left
- bsr.s FindTag
- cmpa.l #0,a2
- beq.s NoWinTags
- move.l #0,(a2) ; New WA_Left
-
- move.l a1,a2 ; Pointer to tag list
- move.l #$80000065,d2 ; Search for WA_Top
- bsr.s FindTag
- cmpa.l #0,a2
- beq.s NoWinTags
- move.l #0,(a2) ; New WA_Top
-
- move.l a1,a2 ; Pointer to tag list
- move.l #$80000066,d2 ; Search for WA_Width
- bsr.s FindTag
- cmpa.l #0,a2
- beq.s NoWinTags
- move.l #640,(a2) ; New WA_Width
-
- move.l a1,a2 ; Pointer to tag list
- move.l #$80000067,d2 ; Search for WA_Height
- bsr.s FindTag
- cmpa.l #0,a2
- beq.s NoWinTags
- move.l #100,(a2) ; New WA_Height
- NoWinTags:
- movem.l (sp)+,d2/a2
- jmp $0
-
- ;----------------------- Find a tag and get value --------------------
- ; In:
- ; A2 - Tag list address
- ; D2 - Tag to search for
- ; Out:
- ; A2 - Address of tag value
- ; D2 - Tag value
- ;
-
- FindTag:
- suba.l #4,a2 ; Adjust for loop
- .SearchTag:
- adda.l #4,a2 ; Adjust for next tag
- cmp.l #0,(a2) ; TAG_END ?
- bne.s .MoreTags
-
- moveq.l #0,d2 ; Clear value
- move.l d2,a2 ; Clear address
- bra.s .NoMoreTags
- .MoreTags:
- cmp.l (a2)+,d2 ; Check for tag
- bne.s .SearchTag ; Not found - continue until TAG_END
- move.l (a2),d2 ; Get value of tag
- .NoMoreTags:
- rts
-
-
- FixSize: equ *-NewOpenWinTags
-
-